Ext.define('cc.self.util.SelfService', {
	uses: ['bmc.common.util.Ajax'],
	
	/**
	 * 创建自营记录
	 */
	createSelfBus: function(data, cb, fb) {
		Bmc.Ajax.post('selfbus/create', data, cb, fb);
	},
	/**
	 * 编辑自营记录
	 */
	updateSelfBus: function(data, cb, fb) {
		Bmc.Ajax.post('selfbus/update', data, cb, fb);	
	},
	/**
	 * 删除自营记录
	 */
	deleteSelfBus: function(id, cb, fb) {
		Bmc.Ajax.post('selfbus/delete', {id: id}, cb, fb);
	},
	/**
	 * 创建自营结汇
	 */
	createSelfJh: function(data, cb, fb) {
		Bmc.Ajax.post('selfjh/create', data, cb, fb);
	},
	/**
	 * 编辑自营结汇
	 */
	updateSelfJh: function(data, cb, fb) {
		Bmc.Ajax.post('selfjh/update', data, cb, fb);
	},
	/**
	 * 删除自营结汇
	 */
	deleteSelfJh: function(id, cb, fb) {
		Bmc.Ajax.post('selfjh/delete', {id: id}, cb, fb);
	},
	/**
	 * 获取实体
	 */
	getSelfFactory: function(key, cb, fb){
		Bmc.Ajax.get('selffactory/get', {
			id: key
		}, cb, fb);
	},
	/**
	 * 创建实体
	 */
	createSelfFactory: function(data, cb, fb){
		Bmc.Ajax.post('selffactory/create', data, cb, fb);
	},
	/**
	 * 更新实体
	 */
	updateSelfFactory: function(data, cb, fb){
		Bmc.Ajax.post('selffactory/update', data, cb, fb);
	},
	/**
	 * 删除实体
	 */
	deleteSelfFactory: function(key, cb, fb){
		Bmc.Ajax.post('selffactory/delete', {
			id: key
		}, cb, fb);
	},
	/**
	 * 改变状态
	 */
	updateSelfBusStatus: function(data, cb, fb) {
		Bmc.Ajax.post('selfbus/status', data, cb, fb);
	}
}, function() {
	CC.Self = new this();
});
